﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace NetDisk_WebService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“INetDiskService”。
    [ServiceContract]
    public interface INetDiskService
    {
        /// <summary>
        /// 测试数据库连接是否成功
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string DBConnectTest();
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="logID"></param>
        /// <returns></returns>
        [OperationContract]
        string Login(string loginString);

        /// <summary>
        /// 获取网盘版本号
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetFAppVer();

        /// <summary>
        /// 获取数据库服务器系统时间
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetServerDatetime();

        

        /// <summary>
        /// 获取服务器临时文件夹路径
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetTempDir();

        /// <summary>
        /// 随机获取临时文件名称
        /// </summary>
        /// <param name="FileName"></param>
        /// <returns></returns>
        [OperationContract]
        string GetTempFileName(string FileName);

        /// <summary>
        /// 获取服务器网盘文件夹路径
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetNetDiskDir();

        /// <summary>
        /// 获取网盘httpWebRequest提交地址
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetUploadPostUrl();

        /// <summary>
        /// 获取网盘httpWebRequest提交地址
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetDownloadPostUrl();

        [OperationContract]
        bool CreateDir(string path);

        [OperationContract]
        bool DelDir(string path);

        [OperationContract]
        bool MoveDir(string sourcePath, string destPath);

        [OperationContract]
        bool DelFile(string path);

        [OperationContract]
        bool MoveFile(string sourcePath, string destPath);

        [OperationContract]
        bool CopyFile(string sourcePath, string destPath);

        [OperationContract]
        bool ExistDir(string path);

        [OperationContract]
        bool ExistFile(string path);

        /// <summary>
        /// 增加网盘数据（sql操作）
        /// </summary>
        /// <param name="jsonNetDiskModel"></param>
        [OperationContract]
        string AddNetdisk(string jsonNetDiskModel);

        /// <summary>
        /// 增加网盘数据,覆盖模式（sql操作）
        /// </summary>
        /// <param name="jsonNetDiskModel"></param>
        [OperationContract]
        string AddNetdiskCover(string jsonNetDiskModel);

        /// <summary>
        /// 显示数据（sql操作）
        /// </summary>
        /// <param name="FParentID"></param>
        /// <param name="entityNo"></param>
        /// <param name="orderField"></param>
        /// <returns></returns>
        [OperationContract]
        string GetList(string FParentID, string orderField);

        /// <summary>
        /// 递归显示数据（sql操作）
        /// </summary>
        /// <param name="FParentID"></param>
        /// <param name="strWhere"></param>
        /// <param name="orderField"></param>
        /// <returns></returns>
        [OperationContract]
        string GetListCTE(string FParentID,string strWhere, string orderField);

        /// <summary>
        ///根据登录名获取目录
        /// </summary>
        /// <param name="logID"></param>
        /// <returns></returns>
        [OperationContract]
        string GetDirByLogID(string logID);


        /// <summary>
        /// 获取同一路径下的相同文件夹
        /// </summary>
        /// <param name="FParentID"></param>
        /// <param name="FName"></param>
        /// <returns></returns>
        [OperationContract]
        string GetSameFID(string FParentID, string FName);

        /// <summary>
        /// 删除文件（SQL）
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract]
        string DelNetDisk(string ids);

        /// <summary>
        /// 创建文件夹（SQL）
        /// </summary>
        /// <param name="jsonNetDiskModel"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateDirNetDisk(string jsonNetDiskModel);

        /// <summary>
        /// 复制（SQL）
        /// </summary>
        /// <param name="strIds"></param>
        /// <param name="destDirId"></param>
        /// <returns></returns>
        [OperationContract]
        string CopyNetDisk(string strIds, string destDirId);

        /// <summary>
        /// 移动（SQL）
        /// </summary>
        /// <param name="strIds"></param>
        /// <param name="destDirId"></param>
        /// <returns></returns>
        [OperationContract]
        string MoveNetDisk(string strIds, string destDirId);

        /// <summary>
        /// 重命名
        /// </summary>
        /// <param name="FID"></param>
        /// <param name="FName"></param>
        /// <returns></returns>
        [OperationContract]
        string RenameNetDisk(string FID, string FName);

        /// <summary>
        /// 获取当前id的路径
        /// </summary>
        /// <param name="pId"></param>
        /// <returns></returns>
        [OperationContract]
        string GetPathByPid(string pId);

        /// <summary>
        /// 生成下载文件的压缩包
        /// </summary>
        /// <param name="strIds"></param>
        /// <param name="FParentID"></param>
        /// <returns></returns>
        [OperationContract]
        string DownloadZip(string strIds);

        /// <summary>
        /// 初始文件夹
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string InitMyDirs();

        /// <summary>
        /// 获取一条数据
        /// </summary>
        /// <param name="FID"></param>
        /// <returns></returns>
        [OperationContract]
        string GetNetDisk(string FID);
    }
}
